#ifndef _vfs_bst
#define _vfs_bst

#define NIL '\0'
#define BST_TRUE 1
#define BST_FALSE 0
#define BST_SUCCESS 0
#define BST_EMPTY 1
#define BST_KEY_NOT_FOUND 2
#define BST_FAILURE 100

#define MAX_FILENAME_SIZE 25

#include "globals.h"

/*typedef struct file_descriptor
{
	int is_dir;
	int fd_id;
	int size;
	char file_name[MAX_FILEDIR_NAME_SIZE];
	char path[MAX_PATH_SIZE];
	int blocks[MAX_BLOCKS];
}fd;*/


typedef struct bst_node
{
	struct bst_node *parent;
	struct bst_node *left;
	struct bst_node *right;
	char full_path[MAX_PATH_SIZE+MAX_FILENAME_SIZE];
	fd *file_desc;
}b_node;


b_node *bst_create();
/*Creates the bst, returns the root b_node*/

b_node *bst_search( b_node *bst_root, char *fullpath );

/*searches the BST on the basis of fullpath and returns the searched node*/
int bst_insert ( b_node **bst_root_ptr, fd *data );


/* insert the bst node and returns root */
int bst_delete(b_node **bst_root_ptr, char *fullpath);

/* deletes the bst node and returns root */
/*Prints the bst*/
void print_inorder(b_node *bst_root);

#endif


